package com.oms.model;

import javax.swing.table.AbstractTableModel;

public class OMSOrderTableModel extends AbstractTableModel {

	private Object[] columnNames;
	private Object[][] data;

	public OMSOrderTableModel(Object[][] data, Object[] columnNames) {
		this.columnNames = columnNames;
		this.data = data;
	}
	
	public int getColumnCount() {
		return columnNames.length;
	}

	public int getRowCount() {
		return data.length;
	}

	public String getColumnName(int col) {
		return (String)columnNames[col];
	}

	public Object getValueAt(int row, int col) {
		return data[row][col];
	}

	public Class getColumnClass(int c) {
		return getValueAt(0, c).getClass();
	}

	public boolean isCellEditable(int row, int col) {
		return false;
	}
	
	public void setData(Object[][] data) {
		this.data = data;
		fireTableDataChanged();
	}
	
}
